package com.itheima.youdianda.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.youdianda.entity.YddAdvimg;
import com.itheima.youdianda.mapper.YddAdvimgMapper;
import com.itheima.youdianda.service.YddAdvimgService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2022-05-24
 */
@Service
public class YddAdvimgServiceImpl extends ServiceImpl<YddAdvimgMapper, YddAdvimg> implements YddAdvimgService {


    @Override
    public List<YddAdvimg> getBanner() {
        LambdaQueryWrapper<YddAdvimg> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(YddAdvimg::getAdvimgpos,"15");
        List<YddAdvimg> banner = this.list(wrapper);
        return banner;
    }

    @Override
    public List<YddAdvimg> getShowBanner() {
        LambdaQueryWrapper<YddAdvimg> wrapper = new LambdaQueryWrapper<>();
        wrapper.in(YddAdvimg::getAdvimgpos,"12","13","15");
        List<YddAdvimg> showBanner = this.list(wrapper);
        return showBanner;
    }

    @Override
    public List<YddAdvimg> getSideBanner() {
        LambdaQueryWrapper<YddAdvimg> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(YddAdvimg::getAdvimgpos,"14");
        List<YddAdvimg> sideBanner = this.list(wrapper);
        return sideBanner;
    }

}
